# Python 2.6.4
# Project Euler, Problem 117
# Copyright 2010 Talha Zaman

def fac(n):
    prod = 1
    for i in xrange(2, n+1):
        prod *= i
    return prod

from time import clock
start = clock()
length, ways = 50, 0
for red in range(1+length/2):
    for green in range(1+(length-2*red)/3):
        for blue in range(1+(length-2*red-3*green)/4):
            black = length-2*red-3*green-4*blue
            ways += fac(black+red+green+blue) / (fac(black)*fac(red)*fac(green)*fac(blue))
stop = clock()
print ways
print stop-start
